<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="robots" content="index, follow, all" />
    <title>Grafika\Gd\Image | API</title>

            <link rel="stylesheet" type="text/css" href="../../css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="../../css/bootstrap-theme.min.css">
        <link rel="stylesheet" type="text/css" href="../../css/sami.css">
        <script src="../../js/jquery-1.11.1.min.js"></script>
        <script src="../../js/bootstrap.min.js"></script>
        <script src="../../js/typeahead.min.js"></script>
        <script src="../../sami.js"></script>
        <meta name="MobileOptimized" content="width">
        <meta name="HandheldFriendly" content="true">
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
    
    
    </head>

    <body id="class" data-name="class:Grafika_Gd_Image" data-root-path="../../">
            <div id="content">
        <div id="left-column">
                <div id="control-panel">
                <form id="search-form" action="../../search.html" method="GET">
            <span class="glyphicon glyphicon-search"></span>
            <input name="search"
                   class="typeahead form-control"
                   type="search"
                   placeholder="Search">
        </form>
    </div>

                <div id="api-tree"></div>

        </div>
        <div id="right-column">
                <nav id="site-nav" class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-elements">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="../../index.html">API</a>
            </div>
            <div class="collapse navbar-collapse" id="navbar-elements">
                <ul class="nav navbar-nav">
                    <li><a href="../../classes.html">Classes</a></li>
                                            <li><a href="../../namespaces.html">Namespaces</a></li>
                                        <li><a href="../../interfaces.html">Interfaces</a></li>
                    <li><a href="../../traits.html">Traits</a></li>
                    <li><a href="../../doc-index.html">Index</a></li>
                    <li><a href="../../search.html">Search</a></li>
                </ul>
            </div>
        </div>
    </nav>

                        <div class="namespace-breadcrumbs">
            <ol class="breadcrumb">
                <li><span class="label label-default">class</span></li>
                                                            <li><a href="../../Grafika.html">Grafika</a></li>
                                        <li><a href="../../Grafika/Gd.html">Gd</a></li>
    
                <li>Image</li>
            </ol>
        </div>
                <div id="page-content">
                
    <div class="page-header">
        <h1>
            Image
                
        </h1>
    </div>

    <p>    class
    <strong>Image</strong>        implements
        <a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a>
</p>

        
    

            <div class="description">
            <p>Image class for GD.</p>                    </div>
    
    
    
    
            <h2>Methods</h2>

            <div class="container-fluid underlined">
                    <div class="row">
                <div class="col-md-2 type">
                    
                </div>
                <div class="col-md-8 type">
                    <a href="#method___construct">__construct</a>(resource $gd, string $imageFile, int $width, int $height, string $type, string $blocks = &#039;&#039;, bool $animated = false)
        
                                            <p>Image constructor.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
                </div>
                <div class="col-md-8 type">
                    <a href="#method___clone">__clone</a>()
        
                                            <p>Method called when 'clone' keyword is used.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
                </div>
                <div class="col-md-8 type">
                    <a href="#method_blob">blob</a>(string|<a href="../../Grafika/ImageType.html"><abbr title="Grafika\ImageType">ImageType</abbr></a> $type = &#039;PNG&#039;)
        
                                            <p>Output a binary raw dump of an image in a specified format.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    static&nbsp;<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_createFromFile">createFromFile</a>(string $imageFile)
        
                                            <p>Create Image from image file.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    static&nbsp;<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_createFromCore">createFromCore</a>(resource $gd)
        
                                            <p>Create an Image from a GD resource. The file type defaults to unknown.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    static&nbsp;<a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_createBlank">createBlank</a>(int $width = 1, int $height = 1)
        
                                            <p>Create a blank image.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/Gd/Image.html"><abbr title="Grafika\Gd\Image">Image</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_alphaBlendingMode">alphaBlendingMode</a>(bool $flag)
        
                                            <p>Set the blending mode for an image. Allows transparent overlays on top of an image.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <a href="../../Grafika/Gd/Image.html"><abbr title="Grafika\Gd\Image">Image</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_fullAlphaMode">fullAlphaMode</a>(bool $flag)
        
                                            <p>Enable/Disable transparency</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    bool
                </div>
                <div class="col-md-8 type">
                    <a href="#method_isAnimated">isAnimated</a>()
        
                                            <p>Returns animated flag.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    resource|Imagick
                </div>
                <div class="col-md-8 type">
                    <a href="#method_getCore">getCore</a>()
        
                                            <p>Get GD resource ID.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    string
                </div>
                <div class="col-md-8 type">
                    <a href="#method_getImageFile">getImageFile</a>()
        
                                            <p>Get image file path.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    int
                </div>
                <div class="col-md-8 type">
                    <a href="#method_getWidth">getWidth</a>()
        
                                            <p>Get image width in pixels.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    int
                </div>
                <div class="col-md-8 type">
                    <a href="#method_getHeight">getHeight</a>()
        
                                            <p>Get image height in pixels.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    string
                </div>
                <div class="col-md-8 type">
                    <a href="#method_getType">getType</a>()
        
                                            <p>Get image type.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    <abbr title="Grafika\Gd\string.">string.</abbr>
                </div>
                <div class="col-md-8 type">
                    <a href="#method_getBlocks">getBlocks</a>()
        
                                            <p>Get blocks.</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    array
                </div>
                <div class="col-md-8 type">
                    <a href="#method_histogram">histogram</a>(array|null $slice = null)
        
                                            <p>Get histogram from an entire image or its sub-region.</p>                </div>
                <div class="col-md-2"></div>
            </div>
            </div>


        <h2>Details</h2>

            <div id="method-details">
                    <div class="method-item">
                    <h3 id="method___construct">
        <div class="location">at line         line 60</div>
        <code>                    
    <strong>__construct</strong>(resource $gd, string $imageFile, int $width, int $height, string $type, string $blocks = &#039;&#039;, bool $animated = false)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Image constructor.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>resource</td>
                <td>$gd</td>
                <td>Must use GD's imagecreate* family of functions to create a GD resource.</td>
            </tr>
                    <tr>
                <td>string</td>
                <td>$imageFile</td>
                <td></td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$width</td>
                <td></td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$height</td>
                <td></td>
            </tr>
                    <tr>
                <td>string</td>
                <td>$type</td>
                <td></td>
            </tr>
                    <tr>
                <td>string</td>
                <td>$blocks</td>
                <td></td>
            </tr>
                    <tr>
                <td>bool</td>
                <td>$animated</td>
                <td></td>
            </tr>
            </table>

            
            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method___clone">
        <div class="location">at line         line 73</div>
        <code>                    
    <strong>__clone</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Method called when 'clone' keyword is used.</p>                                </div>
                <div class="tags">
            
            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_blob">
        <div class="location">at line         line 90</div>
        <code>                    
    <strong>blob</strong>(string|<a href="../../Grafika/ImageType.html"><abbr title="Grafika\ImageType">ImageType</abbr></a> $type = &#039;PNG&#039;)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Output a binary raw dump of an image in a specified format.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>string|<a href="../../Grafika/ImageType.html"><abbr title="Grafika\ImageType">ImageType</abbr></a></td>
                <td>$type</td>
                <td>Image format of the dump. See Grafika\ImageType for supported formats.</td>
            </tr>
            </table>

            
            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a target="_blank" href="http://php.net/Exception">Exception</a></td>
                <td>When unsupported type.</td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_createFromFile">
        <div class="location">at line         line 122</div>
        <code>        static            <a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a>
    <strong>createFromFile</strong>(string $imageFile)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Create Image from image file.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>string</td>
                <td>$imageFile</td>
                <td>Path to image file.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
            <td>Instance of image.</td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a target="_blank" href="http://php.net/Exception">Exception</a></td>
                <td></td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_createFromCore">
        <div class="location">at line         line 156</div>
        <code>        static            <a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a>
    <strong>createFromCore</strong>(resource $gd)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Create an Image from a GD resource. The file type defaults to unknown.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>resource</td>
                <td>$gd</td>
                <td>GD resource.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
            <td>Instance of image.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_createBlank">
        <div class="location">at line         line 168</div>
        <code>        static            <a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a>
    <strong>createBlank</strong>(int $width = 1, int $height = 1)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Create a blank image.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>int</td>
                <td>$width</td>
                <td>Width of image in pixels.</td>
            </tr>
                    <tr>
                <td>int</td>
                <td>$height</td>
                <td>Height of image in pixels.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/ImageInterface.html"><abbr title="Grafika\ImageInterface">ImageInterface</abbr></a></td>
            <td>Instance of image.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_alphaBlendingMode">
        <div class="location">at line         line 180</div>
        <code>                    <a href="../../Grafika/Gd/Image.html"><abbr title="Grafika\Gd\Image">Image</abbr></a>
    <strong>alphaBlendingMode</strong>(bool $flag)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Set the blending mode for an image. Allows transparent overlays on top of an image.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>bool</td>
                <td>$flag</td>
                <td>True to enable blending mode.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/Gd/Image.html"><abbr title="Grafika\Gd\Image">Image</abbr></a></td>
            <td></td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_fullAlphaMode">
        <div class="location">at line         line 192</div>
        <code>                    <a href="../../Grafika/Gd/Image.html"><abbr title="Grafika\Gd\Image">Image</abbr></a>
    <strong>fullAlphaMode</strong>(bool $flag)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Enable/Disable transparency</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>bool</td>
                <td>$flag</td>
                <td>True to enable alpha mode.</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><a href="../../Grafika/Gd/Image.html"><abbr title="Grafika\Gd\Image">Image</abbr></a></td>
            <td></td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_isAnimated">
        <div class="location">at line         line 206</div>
        <code>                    bool
    <strong>isAnimated</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Returns animated flag.</p>                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>bool</td>
            <td>True if animated GIF or false otherwise.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_getCore">
        <div class="location">at line         line 215</div>
        <code>                    resource|Imagick
    <strong>getCore</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Get GD resource ID.</p>                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>resource|Imagick</td>
            <td>GD resource or Imagick instance</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_getImageFile">
        <div class="location">at line         line 224</div>
        <code>                    string
    <strong>getImageFile</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Get image file path.</p>                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>string</td>
            <td>File path to image if Image was created from an image file.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_getWidth">
        <div class="location">at line         line 233</div>
        <code>                    int
    <strong>getWidth</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Get image width in pixels.</p>                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>int</td>
            <td>Width in pixels.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_getHeight">
        <div class="location">at line         line 242</div>
        <code>                    int
    <strong>getHeight</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Get image height in pixels.</p>                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>int</td>
            <td>Height in pixels.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_getType">
        <div class="location">at line         line 251</div>
        <code>                    string
    <strong>getType</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Get image type.</p>                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>string</td>
            <td>Type of image. See ImageType.</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_getBlocks">
        <div class="location">at line         line 260</div>
        <code>                    <abbr title="Grafika\Gd\string.">string.</abbr>
    <strong>getBlocks</strong>()
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Get blocks.</p>                                </div>
                <div class="tags">
            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td><abbr title="Grafika\Gd\string.">string.</abbr></td>
            <td></td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method_histogram">
        <div class="location">at line         line 271</div>
        <code>                    array
    <strong>histogram</strong>(array|null $slice = null)
        </code>
    </h3>
    <div class="details">
            
    

                    <div class="method-description">
                                    <p>Get histogram from an entire image or its sub-region.</p>                                </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>array|null</td>
                <td>$slice</td>
                <td>Array of slice information. array( array( 0,0), array(100,50)) means x,y is 0,0 and width,height is 100,50</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>array</td>
            <td>Returns array containing RGBA bins array('r'=>array(), 'g'=>array(), 'b'=>array(), 'a'=>array())</td>
        </tr>
    </table>

            
            
                    </div>
    </div>

            </div>
            </div>

    
            </div>
                <div id="footer">
        Generated by <a href="http://sami.sensiolabs.org/">Sami, the API Documentation Generator</a>.
    </div>

        </div>
    </div>
    </body>

</html>
